package com.julius.design.suanfa.str;

/**
 * @author julius
 * @date 2021-10-21 上午 10:32
 * <p>
 *      左旋换字符串
 * </p>
 */
public class ReverseLeft {


    /**
     * 左旋转字符串
     * @param s
     * @param n
     * @return
     */
    public String reverseLeftWords(String s ,int n){

        StringBuilder stringBuilder = new StringBuilder();

        for (int i = n; i <s.length() ; i++) {
            stringBuilder.append(s.charAt(i));
        }

        for (int i = 0; i < n; i++) {
            stringBuilder.append(s.charAt(i));
        }
        return stringBuilder.toString();

    }
}
